package com.king.pattem.flyweight;

import java.util.HashMap;
import java.util.Map;

/**
 * @author taomk
 * @version 1.0
 * @since 15-1-17 上午10:47
 */
public class ReportManagerFactory {

	private Map<String, IReportManager> financialReportManager = new HashMap<>();

	private Map<String, IReportManager> employeeReportManager = new HashMap<>();

	public IReportManager getFinancialReportManager(String tenantId) {
		IReportManager r = financialReportManager.get(tenantId);
		if (r == null) {
			r = new FinancialReportManager(tenantId);
			financialReportManager.put(tenantId, r);
		}
		return r;
	}

	public IReportManager getEmployeeReportManager(String tenantId) {
		IReportManager r = employeeReportManager.get(tenantId);
		if (r == null) {
			r = new EmployeeReportManager(tenantId);
			employeeReportManager.put(tenantId, r);
		}
		return r;
	}
}
